package com.example.com.skills_utf8;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;

import com.secret.aes;
import com.utils.NetHelper;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class _36Activity extends Activity{

	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_36);
		
		final EditText et_data = (EditText)this.findViewById(R.id.et_text);
		final TextView tv_result = (TextView)findViewById(R.id.tv_result);
		Button btn_result =(Button)findViewById(R.id.btn_result);
		
		
		btn_result.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String str_data = et_data.getText().toString();
				String str_result =	m.framework.utils.Data.MD5(str_data);
				tv_result.setText( str_result );
				
				System.out.println("md5加密: "+str_result);
				
			}
		});
		
		
		Button btn_sslclient =(Button)findViewById(R.id.btn_sslclient);
		btn_sslclient.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				/*
				new NetHelper() {
					
					@Override
					public void onComplete(String message) throws JSONException {
						// TODO Auto-generated method stub
						
					}
					@Override
					public String init(ArrayList<BasicNameValuePair> map) {
						// TODO Auto-generated method stub
						return "http://github.com";
					}
				}.start_GET();
				*/
				
			}
		});
		
		
		
		// 测试aes加解密
		try {
			aes.main(null); // 小米3 AES加密后解密
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
	}
	
	
	
	
	
}
